package com.mayi.zds.dao.provider;

/**
 * @ClassName CouponProvider
 * @Author zhong
 * @Date 2019/12/25 23:03:08
 * @Version 1.0
 */
public class CouponProvider {

    public String updateStatusToUsedBitch(String[] array) {
        return updateStausString("2",array);
    }

    public String updateStatusToNotUseBitch(String[] array) {
        return updateStausString("1",array);
    }


    private String updateStausString(String status,String[] array){
        String str = "UPDATE zds_coupon SET status='"+status+"' WHERE id IN (";
        for (int i=0;i<array.length;i++) {
            str += "#{array["+i+"]},";
        }
        return str.substring(0, str.lastIndexOf(","))+")";
    }
}
